package springtest;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.alibaba.druid.pool.DruidDataSource;
import com.teamsea.bean.Bean01;

public class SpringIOCTesst {

    private ClassPathXmlApplicationContext context;

    @BeforeEach
    public void setContext() {
        context = new ClassPathXmlApplicationContext("applicationContext.xml");
    }

    @Test
    public void beanTest() {

        DruidDataSource dataSource = context.getBean("dataSource", DruidDataSource.class);

        System.out.println(dataSource);

    }

    @Test
    public void getBean01Test() {
    	
        Bean01 bean = context.getBean("bean01", Bean01.class);

        System.out.println(bean);

    }

}
